<template>
      <div class="box">
            <div id="main" style="width: 500px;height:400px;"></div>
            <div id="min" style="width: 400px;height: 400px"></div>
            <div ID="mins" style="width: 300px;height: 300px"></div>
      </div>
</template>

<script>
import*as Echarts from 'echarts'

export default {
    data(){
      return{

      }
    },
  methods:{

  },
  mounted() {
              var myChart = Echarts.init(document.getElementById('main'));
              var option = {
                title: {
                  text: 'ECharts 入门示例'
                },
                tooltip: {},
                legend: {
                  data:['销量']
                },
                xAxis: {
                  data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
                },
                yAxis: {},
                series: [{
                  name: '销量',
                  type: 'bar',
                  data: [5, 20, 36, 10, 10, 20]
                }]
              };
              myChart.setOption(option);


       var myCharts = Echarts.init(document.getElementById('min'));
          var options = {
            title: {
              text: '某站点用户访问来源',
              subtext: '纯属虚构',
              left: 'center'
            },
            tooltip: {
              trigger: 'item',
              formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            legend: {
              orient: 'vertical',
              left: 'left',
              data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎']
            },
            series: [
              {
                name: '访问来源',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: [
                  {value: 335, name: '直接访问'},
                  {value: 310, name: '邮件营销'},
                  {value: 234, name: '联盟广告'},
                  {value: 135, name: '视频广告'},
                  {value: 1548, name: '搜索引擎'}
                ],
                emphasis: {
                  itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }
            ]
          };

    myCharts.setOption(options);



  }
}
</script>

<style scoped>

</style>